%if current_page!= 1:
	<a href="{{page_link_prefix or '/'}}">第一页</a>&nbsp;
%end
%if current_page > 1:
	%if current_page - 1 == 1:
		<a href="{{page_link_prefix or '/'}}">&lt;&lt;</a>&nbsp;
	%else:
		<a href="{{page_link_prefix}}/page/{{current_page-1}}">&lt;&lt;</a>&nbsp;
	%end
%end
%from utils import page_size
%page_num = range(0,page_cnt)
%begin_index=0
%end_index=page_size
%mid = int(page_size / 2) + 1
%if current_page > mid:
	%begin_index =  current_page - mid
	%end_index =  current_page + mid -1
%end
%if page_cnt - current_page < mid:
	%begin_index =  page_cnt - page_size
	%end_index =  page_cnt
%end
%for i in page_num[begin_index:end_index]:
	%if current_page == i+1:
		<span>{{i+1}}&nbsp;</span>
	%elif i+1 == 1:
		<a href="{{page_link_prefix or '/'}}">{{i+1}}</a>&nbsp;
	%else:
		<a href="{{page_link_prefix}}/page/{{i+1}}">{{i+1}}</a>&nbsp;
	%end
%end
%if current_page >= 1 and current_page < page_cnt:
	<a href="{{page_link_prefix}}/page/{{current_page+1}}">&gt;&gt;</a>&nbsp;
%end
%if current_page!= page_cnt:
	<a href="{{page_link_prefix}}/page/{{page_cnt}}">最后一页</a>&nbsp;
%end